package com.topisv.tms.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.topisv.tms.entity.WarehouseTransfer;

/**
 * 
 *
 * @author yuansheng
 * @version 1.0.0
 */
public interface WarehouseTransferDao  extends PagingAndSortingRepository<WarehouseTransfer, Long>, JpaSpecificationExecutor<WarehouseTransfer> {

    List<WarehouseTransfer> findByCustomerCodeAndWarehouseCode(String customerCode, String warehouseCode);
    
    @Modifying
    @Query("delete from WarehouseTransfer where customerCode=?1 AND warehouseCode=?2")
    void deleteByCustomerCodeAndWarehouseCode(String customerCode, String warehouseCode);
}
